package unit01;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wangzhuangzhuang
 * @DESC:
 * @date 2022-05-03 14:39
 */
public class DefaultMethodDemo {
	public static void main(String[] args) {
		List<Integer> nums = new ArrayList<>();
		nums.add(-3);
		nums.add(1);
		nums.add(4);
		nums.add(-1);
		nums.add(5);
		nums.add(9);
		boolean removed = nums.removeIf(n -> n <= 0); // removeIf将删除集合中所有不满足Predicate条件的元素
		System.out.println("Elements were " + (removed ? "" : "NOT") + " removed");
		nums.forEach(System.out::println);
	}
}

interface Employee {
	String getFirst();

	String getLast();

	void convertCaffeineToCodeForMoney();

	default String getName() {
		return String.format("%s %s", getFirst(), getLast());
	}
}